package servlet;

import sevletpojo.Request;
import sevletpojo.Response;

/**
 * @author 王瑞
 * @description:
 * @date 2020/3/1  21:17
 */
public abstract class HttpServlet implements Servlet {

    public abstract void doPost(Request request, Response response);

    public abstract void doGet(Request request, Response response);

    @Override
    public void service(Request request, Response response) throws Exception {

        if (request.getMethod().equals("GET")){
            doGet(request,response);
        }else {
            doPost(request,response);
        }

    }
}
